package com.pay.allmoney.dto;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016101700707755";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCCOAhiA8BdgsieG/RZx4OK2kiusIDPRz4hjQy4/q0nbvHJSrXGpz6JGRTwkZs9rag3evgD48gujCcom4wzwzTQZynW8SJ2i579qOA2nhGz3/zAEf4QcW6BUwtpLRpJ4t7vO0m+JgCKEbr4Tvpp2qJDf2tfULk2mhOsG0qpQAJ2e55+0Usqt6Ti9nSRChb2UfH5LiNgsa+fOARJvBIBtr2MoMb/yG4KlWh57DRZBuFCgcPqhiS3DkWKKTYPEusdo+mFHszMtKhHmg77DmT2lquGpba+2JPEVOKuTC0cOkJoCBy+9+uiC4ZDuS8EOFrzZm9pd4EmsFHKWQlXc534IN6zAgMBAAECggEAG2Pf14YEe2bb/e3RWuUNdTJu4Ve88FyC5BnAGFVxZH8Amp99Vris/bdp4SQvbCzP2kOiUWcjHy9ZuT/moKipvkBE27JC1n6Nxbs01igvfw9ZIalnMFw7qzYli0zyX6I51EY7P6TMrj4Gft5V69gSE3KEyjq3ipWkF6px7OHK4tLWDlQNvXrIYQ5yybPNlcavdPIQRdH2fceU0yfVXpamJW9xoIiTRj7hrfpdUfugPNnFNcCUXfuw2lXP4IJNddU0XgRGiSJaV8Wa3aGQH4Qijl19n4xDctASGyx1S9HmwNWnUqdo+u8VAuL8/qZ0L9PVSd4jxrEOmNZSnJDBs5PbAQKBgQDU9Dsu6TtZqnH7PLJ/L69yDwR6JElmyXEhSVDADWoZBIhvfxzfX2ZZuYOChWYqRNhs4ZxV3k23bGyq3JArTKL2lBT6IiuS0JP0ElWk6k7dwlHYV2+A8ooClkg+aWCpf7peGqykr801764ibZjwD+SK5fyHz/wN66LRdP+Yii/lgQKBgQCcin3Rf3vszyr7zk4Ph2oTsLaXdzxSRhxpwc3ww892DAyMUZbRMWlVo63PXdVguFrNbuieA2iRt+sdmroz3Q/82rRGaTlB2Ns7SteoII4cpZeF1qu+PwRV1C8VHd7Xm5RnchVRHeJHAZtdrPlJApg/9log71wyTckwftT+WQUmMwKBgCr3aCWL62ypBjxhv8YHsgd6XjXismipxkioCUHmsvx/PKP6arHrBrSdyJoCHl3y7BPz5V4x705N8xL6U6BY4xyLPjxFvrLtoJyDQoJ2wBjgRzE2WwoSZaQl/EeTbWxlmA26phDIY8g5JtJNeKkfG8amprAkV7/bRkuqppN5djaBAoGAWnGl2ioHBr53fj8nWM+LWU8LYB3zCzIY7n2cKBRqRDEX+uaU9c7PpjxIivwS8avyQqlm2wzrGO4jeNpR5O8/cn9GEzxuaX4KxIosaaZNlX2TOy/Z0LSGI7TRcyjr/LSWHOKMMG7MsuvZwVjUOvu1zZbfYhIJucK5kDxngYEbeYMCgYBUSg/Hsvuggh01qjLBSDpdFWNw95YJdS2ElFsNIMHX7Rb4ONgEOzGSPj+lfkPUh+V04TdmiV4Gm2Jl3tPYtgrfNREAHES6a4LdB0jKTtBbYBbl41PpSXxLsuBpC/9xWR9DZaCsyOv8OC3fS5LOqjUw54sbDwSjwpJkhg9Mdnbg0g==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyejWtIPVv0UTZWBzyaohfab5ecRS7lz7LpZubnCydIdHwcLuRa79Mc7wdsKsibdaAK29Syw1U72rFVNMqI2wy5MocnL/di/b4eo+xG2Fd9kJSbiNniEFqVuwDLT4Qze01BBaBYcXVQwdI9Qd5i8w5UbJmhjFV4smpaLjGuDlxysd/gSZUmcpH9NO7exY+jufhdbIYhQ+PlYJWL2reyEOGqEX3n9gJ5tDyo1f5hcxaZUmgqxq+YXEuxBwtTsMAKf8vaBft5Ps5q7wHbZiwpzZhclTTysV6o8zP+ryHIOVDpMjfwwkBWRAAbQygYWAjmTLVtJzV6jhHx5UWTnuHldHqQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "http://localhost:8080/alipay/notifyUrl";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	//public static String return_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://localhost:8080/alipay/returnUrl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "d:/alipay/teselog/";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

